package com.example.finaltool.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.finaltool.model.db.SysCorpStation;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author dengbw
 */
@Mapper
public interface SysCorpStationMapper extends BaseMapper<SysCorpStation> {
    @Insert("INSERT INTO `sys_corp_station`(`ding_corp_id`, `village_code`, `village_id`, `sub_tenant_id`) VALUES (#{corpId}, #{bianhao}, #{id}, #{subId});")
    void save(String corpId, String bianhao, String id, Long subId);

    @Select("SELECT s.sub_tenant_id FROM sys_corp_station s WHERE s.ding_corp_id = #{corpId}")
    List<Long> getSubIds(String corpId);
}
